<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<!--<h1 style="text-align: center;">新页面</h1>
<script type="text/javascript">

    var parseQueryString = function () {

        var str = window.location.search;
        var objURL = {};

        str.replace(
            new RegExp("([^?=&]+)(=([^&]*))?", "g"),
            function ($0, $1, $2, $3) {
                objURL[$1] = $3;
            }
        );
        return objURL;
    };

    //Example how to use it:
    var params = parseQueryString();

    alert(params["name"]);


   /* var info = location.search.slice(); // 从location对象中的search属性得到地址栏里 ? 后面的参数       【接参】
    console.log(info)*/
</script>-->
    <h1>跳转过来的页面</h1>
    <h4>取的参数如下：</h4>
    <div style="min-width: 480px; max-width: 36%;margin: 0 auto; text-align: left;">
        <h4>姓名：<span class="name"></span></h4>
        <h4>性别：<span class="sex"></span></h4>
        <h4>职业：<span class="position"></span></h4>
        <h4>csdn：<a class="link" href=""></a></h4>
    </div>

    <script>
        // 取参并转为json对象
        const param = JSON.parse(localStorage.params);
        // 获取页面元素并赋值
        document.querySelector('.name').innerText = param.name;
        document.querySelector('.sex').innerText = param.sex;
        document.querySelector('.position').innerText = param.position;
        document.querySelector('.link').innerText = param.blogurl;
        document.querySelector('.link').href = param.blogurl;
    </script>

</body>
</html>